﻿<navigation:Page x:Class="LEEAAttendanceControl.Views.Employees" 
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:df="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="Employees"
           xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
           xmlns:my="clr-namespace:LEEAAttendanceControl.Web.Services"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">

        <Grid x:Name="LayoutRoot" 
          Margin="2">
       
        <ScrollViewer BorderThickness="0"  VerticalScrollBarVisibility="Auto" Padding="12,0,12,0" Margin="-12">
            <StackPanel Margin="0,12,0,12" Orientation="Vertical" >
                <Grid Background="#404041">
                    <TextBlock Text="Employees" Foreground="White" FontSize="14" FontWeight="Bold" Margin="5,3,3,2"/>
                </Grid>

                <riaControls:DomainDataSource Name="EmployeeDataSource" LoadSize="30" AutoLoad="True"
                                              LoadingData="EmployeeDataSource_LoadingData" PageSize="15"
                                              QueryName="GetEmployeesWithCompanyAndDepartmentsAndEmployeeId">
                    <riaControls:DomainDataSource.DomainContext>
                        <my:LEEAContext />
                    </riaControls:DomainDataSource.DomainContext>
                    </riaControls:DomainDataSource>
                
                <sdk:DataGrid Name="GRDEmployee" AutoGenerateColumns="False"  IsReadOnly="True" Height="Auto"
                              ItemsSource="{Binding Data, ElementName=EmployeeDataSource}" HeadersVisibility="All"
                              VerticalContentAlignment="Stretch">
                    <sdk:DataGrid.Columns>
                        <sdk:DataGridTextColumn x:Name="EmployeeCodeColumn" Binding="{Binding EmployeeCode}"
                                                Header="ID" Width="60" />
                        
                        <sdk:DataGridTextColumn x:Name="DepartmentNameColumn" Header="Department" Width="124"
                                                Binding="{Binding Path=Department.DepartmentName}" />
                        
                        <sdk:DataGridTextColumn x:Name="FirstNameColumn" Binding="{Binding FirstName}"
                                                Header="First Name" Width="120" />
                        
                        <sdk:DataGridTextColumn x:Name="LastNameColumn" Binding="{Binding LastName}"
                                                Header="Last Name" Width="120" />
                        
                        <sdk:DataGridTextColumn x:Name="AddressColumn" Binding="{Binding Address}" Header="Address"
                                                Width="120" />
                        
                        <sdk:DataGridTextColumn x:Name="PhoneColumn" Binding="{Binding Phone}" Header="Phone"
                                                Width="103" />
                        
                        <sdk:DataGridTextColumn x:Name="MobileColumn" Binding="{Binding Mobile}" Header="Mobile"
                                                Width="120" />
                      </sdk:DataGrid.Columns>
      
                </sdk:DataGrid>
                <sdk:DataPager Name="EmployeePager" Source="{Binding Data, ElementName=EmployeeDataSource}"
                               PageSize="20" Margin="0,-1,0,0"/>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</navigation:Page>
